<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
	<link rel="stylesheet" href="../../styles/index.css">
	<style>
		.box1 {
			width: 200px;
			height: 200px;
			background: skyblue;
		}

		.box2 {
			width: 100px;
			height: 100px;
			background: pink;
			/* 现象：加上margin-top后 box1 也会被顶下来 */
			/**
			 * 解决方法很多
			 *	1.box1里文字内容
			 *  2.给box1设置一个border
			 *  3.bfc 格式化上下文
			 *  4.用 flex，grid 布局
			 */
			margin-top: 20px;

		}
	</style>
</head>

<body>
	<div class="container">
		<div class="box box1">
			<div class="box box2"></div>
		</div>
	</div>
</body>

</html>